package ch.fhnw.apsi.db;

import java.sql.SQLException;

import ch.fhnw.apsi.beans.Credentials;
import ch.fhnw.apsi.beans.Firma;

public interface DB {

  /** check if the old and city are a correct pair. */
  public abstract boolean checkPLZ(int plz, String ort) throws SQLException;

  /** Register new Firma and create Credentials with new password. This also set's the id of the Firma. */
  public Credentials createFirma(Firma firma, char[] password) throws SQLException;

  public void updateFirma(Firma firma) throws SQLException;

  public Firma getFirma(long id) throws SQLException;

  /** Deletes Firma and User! */
  public void deleteFirma(Firma firma) throws SQLException;

  public boolean isValid() throws SQLException;

  public Credentials getCredentials(String username) throws SQLException;

  public void updateCredentials(Credentials newCreds) throws SQLException;
}